<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html:html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
	<meta http-equiv="description" content="ebb365">
	<title>经销商对象编辑</title>
	<link rel="stylesheet" type="text/css" href="/admin/css/css.css"></link>
	<LINK title=win2k-cold-1 media=all href="/command/calendar/calendar-brown.css"  type=text/css rel=stylesheet>
	<SCRIPT src="/command/calendar/calendar.js" type=text/javascript></SCRIPT>
	<SCRIPT src="/command/calendar/calendar-en.js" type=text/javascript></SCRIPT>
	<SCRIPT src="/command/calendar/changebg.js" type=text/javascript></SCRIPT>
	<SCRIPT src="/command/calendar/calendar-setup.js" type=text/javascript></SCRIPT>
	<script type='text/javascript'
		src='/dwr/interface/CountryAreaSelect.js'></script>
	<script type='text/javascript' src='/dwr/engine.js'></script>
	<script type='text/javascript' src='/dwr/util.js'></script>
	<script type="text/javascript">
		function getAllProv() {
		    CountryAreaSelect.getAllProvinces(provSelectOptions);
		 }
 
		 function getCiytByProvId(provID){
		    CountryAreaSelect.getAllCitiesByProvinceId(provID,citySelectOptions);
		 }
		 
		 function getDiquByCityId(cityID){
		    CountryAreaSelect.getAllDiquesByCityId(cityID,diquSelectOptions);
		 }
		 
		 function provSelectOptions(provList){
		     DWRUtil.removeAllOptions("provid");
		     DWRUtil.addOptions("provid", {'-2':'请选择'}); 
		     DWRUtil.addOptions("provid", provList);   
		 }
		 
		 function citySelectOptions(cityList){
		      DWRUtil.removeAllOptions("cityid");
		      DWRUtil.removeAllOptions("diquid"); 
		      DWRUtil.addOptions("diquid", {'-2':'请选择'}); 
		      DWRUtil.addOptions("cityid", {'-2':'请选择'}); 
		      DWRUtil.addOptions("cityid", cityList); 
		 }
		 
		  function diquSelectOptions(diquList){
		      DWRUtil.removeAllOptions("diquid");
		      DWRUtil.addOptions("diquid", {'-2':'请选择'}); 
		      DWRUtil.addOptions("diquid", diquList); 
		 }
		 
		 function getProvSelected(selectObj){
		       for(var i = 0; i < selectObj.options.length; i++){
			       if (selectObj.options[i].selected){
			         var id = selectObj.options[i].value;
			          getCiytByProvId(id);
			       }
			   }
		 }
 
		 function getCitySelected(selectObj){
		       for(var i = 0; i < selectObj.options.length; i++){
			       if (selectObj.options[i].selected){
			         var id = selectObj.options[i].value;
			          getDiquByCityId(id);
			       }
		       }
		  }
</script>


</head>
<body>
	<logic:present name="singleDealer" scope="request">
		<html:form action="/admin/dealer/add.do?action=update"
			enctype="multipart/form-data">
			<input type="hidden" name="bkpage" value="${param['bkpage']}" />
			<input type="hidden" name="bkisCommend" value="${param['isCommend']}" />
			<input type="hidden" name="bkifCheck" value="${param['ifCheck']}" />
			<input type="hidden" name="bkhyType" value="${param['hyType']}" />
			<input type="hidden" name="bkprovId" value="${param['provId']}" />
			<input type="hidden" name="bkcityId" value="${param['cityId']}" />
			<input type="hidden" name="bkqyjb_cpName" value="${qyjb_cpName}" />
			<table align="center">
				<tr>
					<td colspan="2" align="center">
						<b>企业信息</b>
					</td>
				</tr>
				<tr>
					<td>
						企业信息表ID:
					</td>
					<td>
						${singleDealer.id}
						<html:hidden property="id" value="${singleDealer.id}" />
					</td>
				</tr>
				<tr>
					<td>
						企业基表ID:
					</td>
					<td>
						${singleDealer.qiyejibiao.userid}
						<html:hidden property="userid"
							value="${singleDealer.qiyejibiao.userid}" />
					</td>
				</tr>
				<tr>
					<td>
						企业用户名:
					</td>
					<td>
						${singleDealer.qiyejibiao.cpUsername}
					</td>
				</tr>
				<tr>
					<td>
						公司名称:
					</td>
					<td>
						${singleDealer.qiyename}
						<html:hidden property="qiyename" value="${singleDealer.qiyename}"></html:hidden>
					</td>
				</tr>
				<tr>
					<td title="显示在新闻中">
						公司logo：
					</td>
					<td>
						<html:file property="logoFile"></html:file>
						<c:if test="${singleDealer.logo!=''}">
							<a href="/fileUpload/logo/${singleDealer.logo}">原图片</a>
						</c:if>
					</td>
				</tr>

				<tr>
					<td title="显示在招商通首页">
						公司图片：
					</td>
					<td>
						<html:file property="imageFile"></html:file>
						<c:if test="${singleDealer.images!=''}">
							<a href="/fileUpload/qiyeinfo/${singleDealer.images}">原图片</a>
						</c:if>
					</td>
				</tr>
				<tr>
					<td title="显示在招商通首页">
						商铺图片：
					</td>
					<td>
						<html:file property="shopHeadImage"></html:file>
						<c:if test="${singleDealer.shopHeadImage!=''}">
							<a href="/fileUpload/qiyeinfo/${singleDealer.shopHeadImage}">原图片</a>
						</c:if>
					</td>
				</tr>

				<tr>
					<td>
						公司地址:
					</td>
					<td>
						<html:text property="address" value="${singleDealer.address}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						公司网站:
					</td>
					<td>
						<html:text property="qyhttp" value="${singleDealer.qyhttp}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						到期时间:
					</td>
					<td>
					<c:if test="${singleDealer.qiyejibiao!=null}">
					<c:set var="endTimeStr" value="${singleDealer.qiyejibiao.dqtime}"></c:set>
					<html:text property="dqtimeStr" value="${fn:substring(endTimeStr,0,10)}" style="width:110px" onclick="calendar();"></html:text>
					</c:if>
					</td>
				</tr>
				<tr>
					<td>
						省市区:
					</td>
					<td>

						<html:select property="provid" onchange="getProvSelected(this);"
							value="${provId}">
							<option value="-1">
								请选择
							</option>
							<html:optionsCollection name="provList" label="prov"
								value="provId" />
						</html:select>

						<html:select property="cityid" onchange="getCitySelected(this);"
							value="${cityId}">
							<option value="-1">
								请选择
							</option>
							<html:optionsCollection name="cityList" label="city"
								value="cityId" />
						</html:select>

						<html:select property="diquid" value="${diquId}">
							<option value="-1">
								请选择
							</option>
							<html:optionsCollection name="diquList" label="diquming"
								value="diquId" />
						</html:select>
					</td>
				</tr>
				<tr>
					<td>
						客服电话:
					</td>
					<td>
						<html:text property="tel" value="${singleDealer.tel}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						公司传真:
					</td>
					<td>
						<html:text property="fax" value="${singleDealer.fax}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						销售热线:
					</td>
					<td>
						<html:text property="mobile" value="${singleDealer.mobile}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						联系人:
					</td>
					<td>
						<html:text property="linkname" value="${singleDealer.linkname}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						联系人职务:
					</td>
					<td>
						<html:text property="linkzhi" value="${singleDealer.linkzhi}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						客服邮箱:
					</td>
					<td>
						<html:text property="qyemail" value="${singleDealer.qyemail}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						是否锁定:
					</td>
					<td>

						<input name="ifdel" type="radio" value="1"
							<c:if test="${singleDealer.qiyejibiao.ifdel == 1}">checked</c:if>>
						是
						</input>
						<input name="ifdel" type="radio" value="0"
							<c:if test="${singleDealer.qiyejibiao.ifdel == 0}">checked</c:if>>
						否
						</input>
					</td>
				</tr>
				<tr>
					<td>
						邮政编码:
					</td>
					<td>
						<html:text property="code" value="${singleDealer.code}"></html:text>
					</td>
				</tr>
				<tr>
					<td>
						公司简介:
					</td>
					<td>
						<html:textarea property="intro" value="${singleDealer.intro}"
							cols="50" rows="10" />
					</td>
				</tr>
				<tr>
					<td>
						企业精神：
					</td>
					<td>
						<html:textarea property="companySpirit"
							style="width:300px; height:100px;"
							value="${singleDealer.companySpirit}"></html:textarea>
					</td>
				</tr>
				<tr>
					<td>
						<html:submit>提交</html:submit>
					</td>
					<td>
						<html:reset>重置</html:reset>
					</td>
				</tr>
			</table>
	<SCRIPT type=text/javascript>
    Calendar.setup({
        inputField     :    "dqtimeStr",  //sendShopTime2 detailForm:sendShopTime  // id of the input field
        ifFormat       :    "%Y-%m-%d",      // format of the input field
        button         :    "dqtimeStr",  // trigger for the calendar (button ID)
        align          :    "dqtimestr",           // alignment (defaults to "Bl")
        singleClick    :    true
    });
</SCRIPT>

		</html:form>
	</logic:present>
	<logic:notPresent name="singleDealer" scope="request">
		sorry ! it's not present.
	</logic:notPresent>
	
</body>
</html:html>
